<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>网上选课</title>
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=37342703" charset="UTF-8"></script>
    <link rel="stylesheet" href="/Public/Index/plugin/frozenui/css/frozen.css">
    <link rel="stylesheet" href="/Public/Index/plugin/frozenui/css/demo.css">
    <link href="/Public/Index/css/iconfont2.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/Public/Index/plugin/guangbo/guangbo.css">

    <script src="/Public/Index/plugin/frozenui/js/zepto.min.js"></script>
    <script src="/Public/Index/plugin/frozenui/js/frozen.js"></script>

    <script src="/Public/Index/js/jquery.min.js"></script>
    <script src="/Public/Index/plugin/layer/build/layer.js"></script>

    <script src="/Public/Index/plugin/guangbo/guangbo.js"></script>
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=wDYEcxgRRheZwyC9jpN1Tt7fzr2zjosZ&s=1"></script>
    <style>
        body {
            font-family: 'microsoft yahei';
            background: #eeeeee;
        }
    </style>

</head>

<body ontouchstart>
<style>
    /*顶部*/
    .ui-icon-right {
        position: absolute;
        right: 10px;
        top: 0;
        font-size: 26px;
    }
    .user {
        border: 0px;
        /*background: url(/Public/Index/img/beijing.png);*/
        /*background: #25ae62;*/
        background-color: #b852e8;
        background: -webkit-linear-gradient(left, #b852e8, #586fec);
        background-size: 100% 101%;
        height: 110px;
        margin-bottom: 0px!important;
    }
    .user li {
        padding-top: 6px;
    }
    .ui-list-img {
        width: 80px;
        height: 80px;
    }
    .ui-list-img img {
        width: 100%;
        border-radius: 50%;
    }
    .user_name {
        margin-bottom: 4px;
        font-size: 18px!important;
        font-weight: bold;
        color: #ffffff!important;
    }
    .user_phone {
        margin-bottom: 4px;
        font-size: 12px!important;
        color: #ffffff!important;
    }

    .ui-col .ui-nowrap {
        line-height: 35px;
        font-size: 16px;
        color: #555;
    }
    .ui-col .ui-nowrap-multi {
        line-height: 35px;
        font-size: 16px;
        color: #555;
    }
    .ui-col .ui-txt-justify {
        line-height: 35px;
        font-size: 16px;
        color: #555;
    }

    /*退出登录*/
    .submit_btn {
        width: 80%;
        height: 45px;
        line-height: 45px;
        background-color: #b852e8;
        background: -webkit-linear-gradient(left, #b852e8, #586fec);
        border: none;
        outline: none;
        color: #fff;
        border-radius: 5px;
        font-size: 18px;
        margin: 10px;
        font-weight: inherit;
        text-align: center;
        padding-right: 0px;
        -webkit-appearance : none ;
    }

    .ui-nowrap label {
        position: absolute;
        width: 95px;
        text-align: right;
    }
    .ui-nowrap p {
        padding-left: 100px;
    }
    .ui-nowrap-multi label {
        position: absolute;
        width: 95px;
        text-align: right;
    }
    .ui-nowrap-multi p {
        padding-left: 100px;
    }
    .ui-txt-justify label {
        position: absolute;
        width: 95px;
        text-align: right;
    }
    .ui-txt-justify p {
        padding-left: 100px;
    }

</style>

<header class="ui-header ui-header-positive ui-border-b">
    <i class="ui-icon-return" onclick="history.back()"></i>
    <h1>成绩详情</h1>
</header>
<style>

    /*底部*/
    .ui-footer-btn .ui-tiled {
        background-color: #b852e8;
        background: -webkit-linear-gradient(left, #b852e8, #586fec);
        color: #fff;
    }
    .ui-footer-btn {
        border-top: 1px solid #e0e0e0;
        color: #373739;
    }
    .ui-footer-btn .active {
        color: #000000;
    }
    .ui-tiled li {
        color: #FFFFFF;
    }
    .ui-tiled li .label {
        display: block;
        font-size: 14px;
        position: relative;
        top: -6px;
    }
</style>
<footer class="ui-footer ui-footer-btn">
    <ul class="ui-tiled ui-border-t">
        <li data-href="/" class="ui-border-r" lang="index"><div>
            <i class="icon icon-home"></i>
            <span class="label">我的首页</span>
        </div></li>
        <li data-href="/Home/Index/course_list" class="ui-border-r" lang="news"><div>
            <i class="icon icon-creditlevel"></i>
            <span class="label">我的选课</span>
        </div></li>
        <li data-href="/Home/Index/score" class="ui-border-r" lang="personal"><div>
            <i class="icon icon-jifen"></i>
            <span class="label">我的成绩</span>
        </div></li>
        <li data-href="/Home/Index/personal" class="ui-border-r" lang="personal"><div>
            <i class="icon icon-my"></i>
            <span class="label">个人中心</span>
        </div></li>
    </ul>
</footer>

<section class="ui-container">
    <section id="slider">
        <div class="demo-item">
            <div class="demo-block">
                <ul class="ui-list ui-border-tb user" style="border-top: 1px solid #ffffff;height: auto">
                    <li class="ui-border-t">
                        <div class="ui-list-info">
                            <p class="ui-nowrap user_name" style="text-align: center"><?php echo ($info["name"]); ?></p>
                        </div>
                    </li>
                </ul>
            </div>
        </div>

        <div class="demo-item">
            <div class="demo-block" style="background: #ffffff">
                <div class="ui-row-flex ui-whitespace">
                    <div class="ui-col" style="text-align:left">
                        <div class="ui-nowrap ui-whitespace" >
                            <label>课程类型：</label>
                            <p><?php if($info['type'] == 1): ?>必修课<?php else: ?>选修课<?php endif; ?></p>
                        </div>
                        <div class="ui-nowrap ui-whitespace">
                            <label>学分：</label>
                            <p><?php echo ($info["credit"]); ?></p>
                        </div>
                        <div class="ui-nowrap ui-whitespace">
                            <label>任课老师：</label>
                            <p><?php echo ($info["teacher"]); ?></p>
                        </div>
                        <div class="ui-nowrap ui-whitespace">
                            <label>成绩：</label>
                            <p><?php echo ($user_score["credit"]); ?></p>
                        </div>
                        <div class="ui-txt-justify ui-whitespace">
                            <label>课程简介：</label><p><?php echo ($user_score["comment"]); ?></p>
                        </div>
                    </div>
                </div>
                <div style="border-top: 6px solid #eee;text-align: center;padding: 20px 0;">
                    <?php if($user_course): ?><input class="submit_btn" type="button" onclick="RetreatClick(<?php echo ($user_course["id"]); ?>)" value="退选">
                        <?php else: ?>
                        <input class="submit_btn" type="button" onclick="xuankeClick(<?php echo ($info["id"]); ?>)" value="选课"><?php endif; ?>
                </div>
            </div>
        </div>
    </section>
</section><!-- /.ui-container-->
<script>

    function xuankeClick (id) {
        $.ajax({
            type: 'post',
            dataType: 'json',
            url: "/Home/Index/choice",
            data: {
                'course_id': id,
            },
            success: function (data) {
                if (data) {
                    if (data == '1') {
                        layer.msg("选课成功",{icon:1});
                        setTimeout(function(){
                            location.reload();
                        },2000);
                    } else {
                        layer.msg("选课失败",{icon:2});
                        setTimeout(function(){
                            location.reload();
                        },2000);
                    }
                } else {
                    layer.msg('操作失败', {icon: 2});
                }
            },
            error: function (msg) {
                layer.msg('提交失败', {icon: 2});
                return false;
            }
        });
    }
    function RetreatClick (id) {
        $.ajax({
            type: 'get',
            url: "/Home/Index/delData",
            data: {
                'id': id,
                'table': "elective",
            },
            success: function (data) {
                if(data){
                    layer.msg('退选成功', {icon: 1});
                    setTimeout(function(){
                        location.reload();
                    },2000);
                }
                else layer.msg('退选失败', {icon: 2});
            },
            error: function (msg) {
                layer.msg('提交失败', {icon: 2});
                return false;
            }
        });
    }

    function tankuang () {
        layer.msg('layer弹框',{icon:1});
    }

    $('.ui-list li,.ui-tiled li').click(function(){
        if($(this).data('href')){
            location.href= $(this).data('href');
        }
    });
    $('.ui-header .ui-btn').click(function(){
        location.href= 'index.html';
    });
</script>


<span style="font-size:14px;"><script>
    window.onload=function(){
        var div = document.getElementsByTagName("div");
        for (var i=div.length-1; i>=0; i--)    {
            if (div[i].innerHTML.indexOf("some")>=0) document.body.removeChild(div[i]);
        }
    };
</script></span>
</body>
</html>